package com.deyuanyun.pic.ae.enumeration;

/**
 * 是否是最新数据
 *
 * @author huanglw
 * @date  2016-11-10
 *
 * History: [修改人][时间][修改描述]
 */
public enum IsNewDateEnum {

    YES("0", "是"),
    NO("1", "否");

    private String code;
    private String label;

    IsNewDateEnum(String code, String label){
        this.code = code;
        this.label = label;
    }

    public String getCode() {
        return code;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public static String getLabel(String code){
        YesOrNoEnum[] yesOrNoEnums = YesOrNoEnum.values();
        for (int i = 0; i < yesOrNoEnums.length; i++) {
            if (yesOrNoEnums[i].toString().equals(code)) {
                return yesOrNoEnums[i].getLabel();
            }
        }
        return null;
    }
}
